#pragma once

class CRequest;
class CListenSocket;

class CWebServer
{
public:
	CWebServer(void);
	~CWebServer(void);

	BOOL StartListening( void );
	void StopListening( void );
	BOOL m_bResetListen;
	CString m_strTitleBase;
	CString m_strRoot;
	CString m_strServer;
	CTime   m_timeStarted;
	UINT    m_uPort;
	int     m_nSvrName;
	BOOL    m_bLoggingOn;
	BOOL    m_bListIcon;
	BOOL    m_bAllowListing;
	// indexes into m_aReStats array....
	enum { STATUS_INFORMATIONAL = 0,
		STATUS_SUCCESS, STATUS_REDIRECTION,
		STATUS_CLIENTERR, STATUS_SERVERERR };
	int     m_aReStats[5]; // array of status group counts
	int     m_nTotalHits; // total hits
	CObList m_reqList; // working list of request objects
	CListenSocket* m_pListen;


	void DocHit( CRequest* pRequest );
	BOOL    IdleProc( LONG lCount );
	void    ExtractStats( CRequest* pRequest );	
};
